<%@ page import="ar.com.photo_admin.domain.User"%>
<!doctype html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta name="layout" content="main">
<calendar:resources lang="en" theme="aqua" />
</head>
<body>
	<div class="container">

		<div class="page-header">
			<h1><g:message code="user.profile" /></h1>
		</div>

		<g:if test="${flash.message}">
			<div class="alert alert-success">
				<a class="close" data-dismiss="alert">×</a>
				${flash.message}
			</div>
		</g:if>
		<g:if test="${flash.error}">
			<div class="alert alert-error">
				<a class="close" data-dismiss="alert">×</a>
				${flash.error}
			</div>
		</g:if>
			
		<div id="eventHeader" class="row">
			<div id="thumbnailContainer" class="span3">
				<img id="coverPhotoImage"
					src="${createLink(controller:'user', action:'profileImage', id:user?.id, params: ['type': user?.useFacebookProfileImage])}"
					class="profilePhoto thumbnail"></img>
			</div>

			<div class="span9">
			
				<h2>${user?.username}</h2>
				<div class="separatorUsingBorder"></div>
			
				<g:if test="${user?.presentationText}">
					<g:textArea id="presentationText" name="presentationText" rows="3" maxlength="200"
						value="${user?.presentationText}"
						disabled="disabled"></g:textArea>
				</g:if>
			</div>
		</div>
			
		<div class="separator"></div>
		<div class="separatorUsingBorder"></div>

		<h2><g:message code="user.profile.personal.data" /></h2>

		<div class="form-horizontal">

				<div
					class="control-group ${hasErrors(bean: user, field: 'username', 'error')}">
					<label class="control-label" for="inputUserName"><g:message
							code="user.username" /></label>
					<div class="controls">
						<g:field id="inputUserName" class="input-large" type="text"
							name="username" value="${user?.username}"
							placeholder="${message(code: 'user.username')}"
							disabled="disabled" />
					</div>
				</div>
				
				<div
					class="control-group ${hasErrors(bean: user, field: 'birthday', 'error')}">
					<label class="control-label" for="inputBirthday"><g:message
							code="user.birthday" /></label>
					<div class="controls">
						<g:field id="inputUserName" class="input-large" type="text"
							name="birthday" value="${user?.getFormattedBirthday()}"
							disabled="disabled" />
					</div>
				</div>
		</div>

		<g:render template="/user/sendMessage" />

		<div class="btn-group">
			<a data-toggle="modal" href="#sendMessageModal" class="btn btn-success">
				<g:message code="user.send.message"/>
			</a>
		</div>
	</div>
	
	<div class="separator"></div>
</body>
</html>